package xin.alum.aim;

import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * Spring boot 启动后自动启动AimSocksServer
 *
 * @auther alum(alum @ live.cn)
 * @date 2021/8/2 12:38
 */
@Component
public class AimStarter implements ApplicationListener<ApplicationStartedEvent> {

    @Autowired
    ClusterMessage clusterMessage;

    @SneakyThrows
    @Override
    public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) {
        AIM.start(clusterMessage);
    }
}
